
package com.microweb.toastmaster.service.impl;

import java.util.List;

import com.microweb.toastmaster.service.impl.BaseManager;
import com.microweb.toastmaster.model.Speech;
import com.microweb.toastmaster.dao.SpeechDao;
import com.microweb.toastmaster.service.SpeechManager;

public class SpeechManagerImpl extends BaseManager implements SpeechManager {
    private SpeechDao dao;

    /**
     * Set the Dao for communication with the data layer.
     * @param dao
     */
    public void setSpeechDao(SpeechDao dao) {
        this.dao = dao;
    }

    /**
     * @see com.microweb.toastmaster.service.SpeechManager#getSpeechs(com.microweb.toastmaster.model.Speech)
     */
    public List getSpeechs(final Speech speech) {
        return dao.getSpeechs(speech);
    }

    /**
     * @see com.microweb.toastmaster.service.SpeechManager#getSpeech(String id)
     */
    public Speech getSpeech(final String id) {
        return dao.getSpeech(new Long(id));
    }

    /**
     * @see com.microweb.toastmaster.service.SpeechManager#saveSpeech(Speech speech)
     */
    public void saveSpeech(Speech speech) {
        dao.saveSpeech(speech);
    }

    /**
     * @see com.microweb.toastmaster.service.SpeechManager#removeSpeech(String id)
     */
    public void removeSpeech(final String id) {
        dao.removeSpeech(new Long(id));
    }
}
